package lormi.meipin.controller.api;


import lormi.meipin.common.Result;
import lormi.meipin.controller.BaseController;
import lormi.meipin.exception.LMException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

/**
 * 美聘活动处理接口
 * */
@RestController
@RequestMapping(value="v2/activity/",method=RequestMethod.POST,produces = "application/json; charset=utf-8")
public class ActivityController extends BaseController{
	/**
	 * 获取单个美聘活动
	 * @Param id 美聘活动ID
	 * */
	@RequestMapping("get")
	@Valid
	public String getOne(@NotNull @RequestParam(value="id",required=false) Integer id) throws LMException{
		return Result.success(activityService.getOneActivity(id));
	}
	
	/**
	 * 获取美聘活动列表
	 **/
	@RequestMapping("list")
	public String getAll() throws LMException{
		return Result.success(activityService.getAll());
	}

}
